import Vue from 'vue'
import Vuex from 'vuex';
//import ajax from '../js/ajax.js'
Vue.use(Vuex);
let state = {
    alarm_list: [],
    user: JSON.parse(localStorage.getItem("users")|| '[]')
};
let mutations = {
    //数据初始
    tableDatanew(state, alarm_list) {
        state.alarm_list = alarm_list;
    },
    //设备编辑
    tableEdit(state, alarm_list) {
        for (let i in state.alarm_list) {
            if (state.alarm_list[i].id == alarm_list.id) {
                state.alarm_list[i].state = 1

            }
        }
    }
};

let actions = {

};

export default new Vuex.Store({
    state,
    actions,
    mutations
});
